<%@ page language="java" import="java.util.*" import="java.io.*"
	contentType="text/html;charset=gb2312"%>
<%@ taglib prefix="s" uri="/struts-tags"%>


<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 
%>

<HTML>
<HEAD>
<TITLE>添加图书类别</TITLE>
<STYLE type=text/css>
BODY {
	MARGIN-LEFT: 0px;
	BACKGROUND-COLOR: #ffffff
}

.STYLE1 {
	color: #ECE9D8
}

.label {
	font-style .: italic;
}

.errorLabel {
	font-style .: italic;
	color: red;
}

.errorMessage {
	font-weight: bold;
	color: red;
}
</STYLE>


<script type="text/javascript">
 
function inputFileOnChange() {
	 alert('value: ');
    if(document.getElementByIdx_x('File1').files) {
 
        // Support: nsIDOMFile, nsIDOMFileList
 
        alert('value: ' + document.getElementByIdx_x('my-file').value);
 
        alert('files.length: ' + document.getElementByIdx_x('my-file').files.length);
 
        alert('fileName: ' + document.getElementByIdx_x('my-file').files.item(0).fileName);
 
        alert('fileSize: ' + document.getElementByIdx_x('my-file').files.item(0).fileSize);
 
        alert('dataurl: ' + document.getElementByIdx_x('my-file').files.item(0).getAsDataURL());
 
        alert('data: ' + document.getElementByIdx_x('my-file').files.item(0).getAsBinary());
 
        alert('datatext: ' + document.getElementByIdx_x('my-file').files.item(0).getAsText("utf-8"));
 
    };
 
};
 
 
function checkFile(){
	var file = document.getElementById("Myfile").files[0];
	if(file){
		alert(file.name);
		}else{
			alert("nothing!");
			}
	}

function fileupload()
{
	document.getElementById('filePath').value=document.getElementById('file').value;
	
}
</script>

	<title>文件上传</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
</HEAD>

<BODY>
	<table>
		<tr>
			<td >
			<form action="cfg/uploadFile.action" method="post" id="cfgReadForm"
						onsubmit="return checkForm();" name="form1" enctype="multipart/form-data">
				<input type="text" id="filePath" name="filePath" style="" /><input type="file" style="width:70"  id="file" name="file" onchange='fileupload();'> 
				<input id="cfgAdd" type="submit" value="summit" />
			</form>
			
			</td>
		</tr>
	</table>
</BODY>
</HTML>
